// https://nuxt.com/docs/api/configuration/nuxt-config

export default defineNuxtConfig({
  css: [
    "v3-scroll/dist/library.mjs.css",
    "~/accets/css/main.css",
    "ant-design-vue/dist/antd.css",
  ],
  vite: {
    optimizeDeps: {
      // 添加该行代码
      include: ["@babel/runtime/regenerator"],
      // 用于：从预捆绑中排除的依赖项
      exclude: [],
    },
  },
  modules: [
    // pinia plugin
    "@pinia/nuxt",
    "@pinia-plugin-persistedstate/nuxt",
  ],
  app: {
    baseURL: "/",
    head: {
      meta: [
        // <meta name="viewport" content="width=device-width, initial-scale=1">
        { charset: "utf-8" },
        {
          name: "viewport",
          content: "width=device-width, initial-scale=1,user-scalable=0",
        },
        { name: "referrer", content: "no-referrer" },
        { hid: "description", name: "description", content: "" },
        { name: "referrer", content: "no-referrer" },
      ],
    },
  },
  plugins: ["~/plugins/ant-design-ui.ts", "~/plugins/pinia.ts"],
  alias: {
    dayjs: "dayjs/esm/",
  },
  nitro: {
    externals: {
      inline: ["uuid", "lodash"],
    },
  },
  build: {
    transpile: [
      "lodash-es",
      "@babel/runtime", // building time: Could not resolve import "@babel/runtime/helpers/esm/objectSpread2.js"
    ],
  },
});
